#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：python_learning 
@File ：data_integrity_check.py
@IDE  ：PyCharm 
@Author ：李涵彬
@Date ：2024/5/30 下午3:40 
"""


# 文件夹下文件是否包含特定文件校验
def check_file_in_folder(folder_path, file_name):
	import os
	for root, dirs, files in os.walk(folder_path):
		for file in files:
			if file.endswith(file_name):
				return True
	return False


# 数据完整性检测
def data_integrity_check(input_folder_path, test_data_integrity_list):
	print(input_folder_path)
	pass_flag_list = []

	# 校验文件完整性
	for file_name in test_data_integrity_list:
		pass_flag = check_file_in_folder(input_folder_path, file_name)
		pass_flag_list.append(pass_flag)
	return all(pass_flag_list), pass_flag_list
